package models

import (
	"tuowei.com/cmd/migrate/migration/models"
	common "tuowei.com/common/models"
)

type SysBalanceDetail struct {
	Id            int     `json:"id" gorm:"primaryKey;autoIncrement;comment:"id"` // id
	BuyerId       int     `comment:"买家id" json:"buyer_id"`                        //买家id
	Title         string  `gorm:"type:varchar(64);not null;default:'';comment:余额变动标题" json:"title"`
	BalanceChange float64 `gorm:"type:decimal(10,2);comment:余额变动" json:"balance_change"`
	Change        int     `gorm:"type:int(10);not null;default:1;index;comment:1余额收入或者支出" json:"change"`
	BalanceSum    float64 `gorm:"type:decimal(10,2);comment:本次变动后的余额总额" json:"balance_sum"`
	common.ControlBy
	models.ModelTime
}

func (SysBalanceDetail) TableName() string {
	return "sys_balance_detail"
}

func (e *SysBalanceDetail) Generate() common.ActiveRecord {
	o := *e
	return &o
}

func (e *SysBalanceDetail) GetId() interface{} {
	return e.Id
}
